package club.zhcs.capture.biz.auth.impl;

import java.util.List;

import club.zhcs.capture.bean.auth.UserPermission;
import club.zhcs.capture.biz.auth.IUserPermissionService;
import club.zhcs.capture.dao.IUserPermissionDao;

import org.nutz.dao.Cnd;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;


@IocBean(name = "userPermissionService")
public class UserPermissionService implements IUserPermissionService {

	@Inject
	IUserPermissionDao userPermissionDao;

	@Override
	public UserPermission save(UserPermission up) {
		return userPermissionDao.save(up);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.dgj.boss.service.auth.IUserPermissionService#findByPermissionId(int)
	 */
	@Override
	public List<UserPermission> findByPermissionId(int id) {
		return userPermissionDao.search(Cnd.where("permissionId", "=", id));
	}
}
